#include <iostream>
#include <list>
#include <fstream>

#include "Board.h"
#include "Gomoku.h"
#include "Heuristic.h"

typedef unsigned short ushort;

class					MyTree
{
// debug beu
public:
	static unsigned int CountTrees;
	static bool			res_stat;
	static Move			Backup;
	
//	Ctors and Dtor
public:
	MyTree();
	MyTree(Board* motherBoard, unsigned short x, unsigned short y, int depth);
	~MyTree();

//	Functions members
public:
	void				AddPiece();
	Move				LaunchMinMax();

private:
	void				InitPoints();
	void				AddChild(unsigned short x, unsigned short y);
	void				SetValue(unsigned short x, unsigned short y);	
	void				SetValue(int c, unsigned short x, unsigned short y);
	
//	Data members
private:
	//std::list<MyTree*>	_PtrsAllocated;
	std::list<Move>		_Points;
	std::list<MyTree*>  _Children;
	Board*				board;
	Move				_lastMove;
	static int			_maxDepth;
	int					_currentDepth;
	Move				_addThisPointIfNoPoints;
public:
	int					heuristic;
	static int			n;
};
